<!-- Content Header (Page header) -->
<section class="content-header">
    <h1>
        IPPI Admin Page
        <small>Fund Rising Product</small>
    </h1>
</section>

<!-- Main content -->
<section class="content">
    <!-- Main row -->
    <div class="row">
        <!-- right col (We are only adding the ID to make the widgets sortable)-->
        <div class="col-xs-12">
            <div class="box">
                <div class="box-header">
                    <h3 class="box-title">Data Table</h3>                                    
                </div><!-- /.box-header -->
                <div class="box-body table-responsive">
                        <!-- .table - Uses sparkline charts-->
                    <table id="example2" class="table table-striped">
                        <thead>
                            <tr>
                                <th>No &nbsp;</th>
                                <th>Judul </th>
                                <th>Datecreated </th>
                                <th>Action </th>
                            </tr>
                        </thead>
                        <tbody>
                        
                        <?php
                        if($this->uri->segment(3)){
                            $i=$this->uri->segment(3)+1;
                        }
                        else $i=1;
                        foreach($list_data as $r):
                        ?>

                            <tr>
                                <td><?php echo $i++;?></td>
                                <td><?php echo $r->product_name;?></td>
                                <td><?php
                                $newDate = date("d M Y <b>h:m:s<b>", strtotime($r->datecreated));
                                echo $newDate;
                                ?></td>
                                <td>
                                <a href="<?php echo site_url()?>admin_product/detail/<?php echo $r->product_id;?>">detail</a> | 
                                <a href="<?php echo site_url()?>admin_product/delete/<?php echo $r->product_id;?>" onclick="return confirm('Apakah anda yakin akan menghapus data ini?')">hapus</a>
                                </td>
                            </tr>
                        <?php
                        endforeach
                        ?>
                        </tbody>
                    </table><!-- /.table -->
                    <a href="<?php echo site_url()?>admin_produk/add" class="btn btn-primary btn-sm"><i class="fa fa-plus"></i> &nbsp;Tambah Data Product</a>
                </div>
            </div>
            <!-- Map box -->
            
            <!-- /.box -->
            
            
        </div><!-- right col -->
    </div><!-- /.row (main row) -->
</section><!-- /.content -->